package com.hkws.hkws.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hkws.hkws.API.DoorResouceApi;
import com.hkws.hkws.pojo.AcsDeviceListRequest;
import com.hkws.hkws.pojo.Devlist;
import com.hkws.hkws.until.JsontoBean;
import org.springframework.scheduling.annotation.Scheduled;

public class testQuery {
    //@Scheduled(initialDelay = 100, fixedRate = 1000)
    public static void main(String[] args) {
        System.out.println("===================");
        DoorResouceApi doorResouceApi = new DoorResouceApi();
        AcsDeviceListRequest acsDeviceListRequest = new AcsDeviceListRequest();
        Devlist devList = new Devlist();
        acsDeviceListRequest.setPageNo(1);
        acsDeviceListRequest.setPageSize(12);
        String s = doorResouceApi.acsDeviceList(acsDeviceListRequest);
        JSONObject jsonObject = JSONObject.parseObject(s);
        JSONArray list = (JSONArray) ((JSONObject) jsonObject.get("data")).get("list");
        JsontoBean<Devlist> objectJsontoBean = new JsontoBean<Devlist>();
        Devlist tansfrom = objectJsontoBean.tansfrom(devList, list);
        System.out.println("tansfrom"+tansfrom);
    }
}